package com.moss.cloud.auth.biz.utils;

import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

public class AuthHandel {
    /**
     *  如果参数为true抛出异常
     *
     * @param b
     * @return com.moss.cloud.common.core.handel.ThrowExceptionFunction
     **/
    public static AuthExceptionHandel trueThrow(Boolean b){
        return (errorMessage) -> {
            if (b){
                throw new OAuth2Exception(errorMessage);
            }
        };
    }
}
